package org.gwu.seuss.server;

import java.io.IOException;
import java.net.ServerSocket;

import org.apache.log4j.Logger;

public class SeussServerFactory {

	static Logger log = Logger.getLogger(SeussServerFactory.class);

	public static SeussServer createNonSecureServer(int port) {
		SeussServer ss = null;
		try {
			ss = new SeussServer(new ServerSocket(port), port);
			return ss;
		} catch (IOException e) {
			log.error(e);
		}
		return ss;

	}

	public static SeussServer createSslServer(char[] storePassword, int port) {
		SeussServer ss = null;
		ss = new SeussServer(
				org.gwu.seuss.communication.sockets.ssl.ServerSocket.createSSLSocket(
						"server.properties", port, storePassword), port);
		return ss;
	}
}
